home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12765 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  78 lines

  1. Path: antoniades.lcs.mit.edu!frankkim
  2. From: frankkim@antoniades.lcs.mit.edu (Frank Kim)
  3. Newsgroups: comp.lang.c++
  4. Subject: C++ questions - please help
  5. Date: 21 Mar 1996 14:28:52 GMT
  6. Organization: MIT Laboratory for Computer Science, Cambridge MA
  7. Message-ID: <4irp34$b6q@GRAPEVINE.LCS.MIT.EDU>
  8. NNTP-Posting-Host: antoniades.lcs.mit.edu
  9.  
  10.  
  11. Hi,
  12.  
  13. I was looking through some code and some of the stuff just stumped me.
  14.  
  15. Question #1:
  16.  
  17. There is a class defined like this...
  18.  
  19. class faxRmApp : public FaxClient {
  20. private:
  21.     fxStr       appName;                // for error messages
  22.     fxStrArray  jobids;
  23.     fxStr       request;
  24.  
  25.     void usage();
  26.     void printError(const char* fmt, ...);
  27.     void printWarning(const char* fmt, ...);
  28. public:
  29.     faxRmApp();
  30.     ~faxRmApp();
  31.  
  32.     void initialize(int argc, char** argv);
  33.     void open();
  34.  
  35.     void recvConf(const char* cmd, const char* tag);
  36.     void recvEof();
  37.     void recvError(const int err);
  38. };
  39.  
  40. and its constructor looks like this:
  41.  
  42. faxRmApp::faxRmApp() : request("remove") {}
  43.  
  44. I don't understand why the request("remove") initialization is outside
  45. the brackets.
  46.  
  47. The next questions are even dumber. :)
  48.  
  49. Question #2
  50.  
  51. Why does the scope of the external declaration not extend beyond the
  52. inner block?
  53.  
  54. {
  55.     {
  56.         extern E;
  57.         E = 0;
  58.     }
  59.     E = 1;
  60. }
  61.  
  62.  
  63.  
  64. Question #3
  65.  
  66. Is there any difference between these two declarations?
  67.  
  68.    char *s1 = "hello";
  69.    char s2[] = "hello";
  70.  
  71.  
  72. Any help would be most appreciated!
  73.  
  74. -- 
  75. Frank Kim    frankkim@catfish.lcs.mit.edu
  76.         http://cag-www.lcs.mit.edu/~frankkim/
  77.                    
  78.